<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

   <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="Monthly Sales Order Reports"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:form prependId="false" rendered="#{loginBacking.viewAllSalesOrderReport}">
                <p:panel header="Monthly Sales Order Reports">
                    <p:messages />
                    <br />
                <h:outputText escape="false" value="#{bundle.ListSaleOrderReportEntityEmpty}" rendered="#{saleOrderReportEntityController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{saleOrderReportEntityController.items.rowCount > 0}">
                    <p:dataTable value="#{saleOrderReportEntityController.items}" 
                                     var="item" style="table-layout:fixed"
                                     paginator="true" rows="10"  
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="5,10,15">
                        <p:column filterBy="#{item.monthOfSales}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListSaleOrderReportEntityTitle_monthOfSales}"/>
                            </f:facet>
                            <h:outputText value="#{item.monthOfSales}"/>
                        </p:column>
                        <p:column filterBy="#{item.yearOfSales}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListSaleOrderReportEntityTitle_yearOfSales}"/>
                            </f:facet>
                            <h:outputText value="#{item.yearOfSales}"/>
                        </p:column>
                        <p:column filterBy="#{item.product.productName}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListSaleOrderReportEntityTitle_product}"/>
                            </f:facet>
                            <h:outputText value="#{item.product.productName}"/>
                        </p:column>
                        <p:column filterBy="#{item.quantity}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListSaleOrderReportEntityTitle_quantity}"/>
                            </f:facet>
                            <h:outputText value="#{item.quantity}"/>
                        </p:column>
                        <p:column filterBy="#{item.type}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListSaleOrderReportEntityTitle_type}"/>
                            </f:facet>
                            <h:outputText value="#{item.type}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{saleOrderReportEntityController.prepareView}" value="#{bundle.ListSaleOrderReportEntityViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{saleOrderReportEntityController.prepareEdit}" value="#{bundle.ListSaleOrderReportEntityEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{saleOrderReportEntityController.destroy}" value="#{bundle.ListSaleOrderReportEntityDestroyLink}"/>
                        </p:column>
                    </p:dataTable>
                </h:panelGroup>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
